<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('更新养修信息预约')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-appointment-edit" th:object="${appointment}">
		<input name="id" type="hidden" th:field="*{id}">
		<div class="form-group">
			<label class="col-sm-3 control-label">客户姓名：</label>
			<div class="col-sm-8">
				<input name="customerName" class="form-control" type="text" th:field="*{customerName}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">联系方式：</label>
			<div class="col-sm-8">
				<input name="customerPhone" class="form-control" type="text" th:field="*{customerPhone}" required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">预约时间：</label>
			<div class="col-sm-8">
				<div class="input-group date">
					<input name="appointmentTime" class="form-control"  th:field="*{appointmentTime}"  placeholder="yyyy-MM-dd HH:mm" type="text" required>
					<span class="input-group-editon"><i class="fa fa-calendar"></i></span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">车牌号码：</label>
			<div class="col-sm-8">
				<input name="licensePlate" class="form-control" type="text" th:field="*{licensePlate}"  required>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">汽车类型：</label>
			<div class="col-sm-8">
				<input name="carSeries" class="form-control" type="text" th:value="${appointment.carSeries}" required>
			</div>
		</div>
	</form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script th:inline="javascript">
	var prefix = ctx + "/business/appointment"
	$("#form-appointment-edit").validate({
		rules:{
			customerPhone:{
				isPhone:true
			}
		},
		messages: {
			"customerPhone":"手机格式不正确"
		},
		focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-appointment-edit').serialize());
		}
	}

	$("input[name='appointmentTime']").datetimepicker({
		format: "yyyy-mm-dd hh:ii",
		autoclose: true
	});
</script>
</body>
</html>